<?php

namespace app\admin\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
use think\Db;
use think\Exception;

class Order extends Command
{

    protected function configure()
    {
        // 指令配置
        $this->setName('Order');
        // 设置参数
        $this->setDescription('数据统计')->setHelp("php think Order");
    }

    protected function execute(Input $input, Output $output)
    {
        $output->writeln('开始执行');
        $time = time() - 60 * 60;
        $order = (new \app\admin\model\Order())
            ->where('status','=',1)
            ->where('create_time','<',$time)
            ->delete();
        $output->writeln('执行结束');
    }
}
